package xyz.xtt.equity.service;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;

import xyz.xtt.equity.api.enums.BenefitEnum;
import xyz.xtt.equity.client.request.TblUserBenefitDto;
import xyz.xtt.equity.entity.TblUserBenefit;
import xyz.xtt.equity.vo.UserVipVO;

/**
 * <p>
 * 用户权益表 服务类
 * </p>
 *
 * @author dale
 * @since 2025-02-10
 */
public interface ITblUserBenefitService extends IService<TblUserBenefit> {

	TblUserBenefit queryLatestUserBenefit(Long appUserId, BenefitEnum tblBenefitEnum);

	// 查询用户是不是会员
	UserVipVO isVip(Long appUserId);

	TblUserBenefitDto queryLatestUserBenefitDto(Long appUserId, BenefitEnum tblBenefitEnum);

	List<TblUserBenefit> queryUserBenefits(Long uid, List<Long> benefitIds);

	List<TblUserBenefit> queryUserValidBenefitsByCode(Long uid, List<String> benefitCodes);

	List<TblUserBenefit> queryUserValidBenefitsByCodeForUpdate(Long uid, List<String> benefitCodes);

	boolean updateBenefitRemain(Long userBenefitId, int newRemain, int oldRemain);

	TblUserBenefit queryUserInitMintBenefit(long appUserId);

	Boolean hasVip(Long appUid);

	Boolean blockUserBenefitByPurchaseRecord(List<Long> list);

	Boolean unBlockUserBenefitByPurchaseRecord(List<Long> list);

	List<TblUserBenefit> queryNotExpiredUserBenefitsByPurchaseRecord(Long recordId);
}
